// 课表相关类型定义

export interface Course {
  id: string;
  name: string;
  teacher: string;
  classroom: string;
  weeks: number[]; // 上课周次
  dayOfWeek: number; // 星期几 (1-7)
  timeSlot: number; // 第几节课 (1-12)
  duration: number; // 持续节数
  credits: number; // 学分
  type: 'required' | 'elective' | 'practice'; // 课程类型
  description?: string;
}

export interface ScheduleData {
  id: string;
  userId: number;
  title: string; // 课表标题
  semester: string; // 学期
  startWeek: number; // 开始周
  totalWeeks: number; // 总周数
  startDate?: string; // 学期开始日期
  endDate?: string; // 学期结束日期
  classTimes?: any; // 上课时间配置
  duration?: number; // 每节课持续时间(分钟)
  description?: string; // 课表描述
  courses: Course[];
  createdAt: string;
  updatedAt: string;
}

export interface SemesterInfo {
  semester: string;
  startDate: string;
  endDate: string;
  totalWeeks: number;
  classTimes?: {
    morning?: string;
    afternoon?: string;
    evening?: string;
  };
  duration?: number; // 每节课持续时间（分钟）
}

export interface TableStructure {
  weekArea: string; // 星期区域位置，如 "A2:E2"
  timeArea: string; // 节次区域位置，如 "A3:A12"
  timeArea2?: string; // 第二个节次区域位置，如 "B3:B12"
  courseArea: string; // 课程区域位置，如 "B3:E12"
  notesArea: string; // 备注区域位置，如 "A1:E1"
}

export interface AIAnalysisResult {
  semesterInfo?: SemesterInfo;
  tableStructure?: TableStructure;
  courses: Course[];
  confidence: number; // 置信度 0-1
  suggestions: string[];
  warnings: string[];
  questions?: string[]; // AI提出的问题
}

export interface FileUploadResult {
  success: boolean;
  message: string;
  data?: {
    fileName: string;
    fileSize: number;
    fileType: string;
    uploadId: string;
  };
}

export interface ScheduleGenerationRequest {
  fileId: string;
  startWeek: number;
  semester: string;
  totalWeeks?: number;
  startDate?: string;
}

export interface ScheduleGenerationResponse {
  success: boolean;
  message: string;
  data?: AIAnalysisResult;
}
